package com.harmonk.firstscene.db.repository

import com.harmonk.firstscene.db.dao.RoadDao
import com.harmonk.firstscene.db.entity.Road
import kotlinx.coroutines.flow.Flow

class RoadRepository(private val roadDao: RoadDao) {
    suspend fun getRoadById(id: Long): Road {
        return roadDao.getRoadById(id)
    }

    fun getAllRoads(): Flow<List<Road>> {
        return roadDao.getAllRoads()
    }

    suspend fun insertRoad(road: Road): Long {
        return roadDao.insertRoad(road)
    }

    suspend fun updateRoad(road: Road) {
        roadDao.updateRoad(road)
    }
    suspend fun deleteRoad(road: Road) {
        roadDao.deleteRoad(road)
    }
}